<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="jquery.js"></script>
</head>
<body>
<!--插入一个元素绑定一个单击事件-->
<p id="app">app</p>
</body>
<script>
    $(function () {
        var showBtn = 'true';
        if (showBtn) {
            var btn = $('<button>Click me</button>');
            btn.on('click', function () {
                console.log('Clicked');
            });
            $('#app').append(btn);
        }
    })
</script>
</html>
